package com.yb.bussiness.tribune;

import java.util.List;

import com.yb.base.dao.BaseDao;
import com.yb.base.dao.IBaseDao;
import com.yb.domain.tribune.TribunePresented;

public class TribunePresentedServiceImpl implements TribunePresentedService {

    private IBaseDao<TribunePresented, Long> dao;

    public TribunePresentedServiceImpl() {
        dao = new BaseDao<TribunePresented, Long>(TribunePresented.class);
    }
    

    public void saveOrUpdate(TribunePresented trip) {
            dao.saveOrUpdate(trip);
    }
    
    public boolean check(TribunePresented presented) {
        boolean flag = false;
        String sql = "select * from t_p_bribune_presented where tid = "+presented.getTid()+" and presentedId="+presented.getPresentedId();
        try {
            List list = dao.findList(sql, new Object[]{});
            if (null != list && list.size() > 0) {
                flag =  true;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return flag;
    }


}
